//
//  ATTwoViewController.m
//  TAUi
//
//  Created by Lin Buken on 16/1/11.
//  Copyright © 2016年 com.aiton. All rights reserved.
//

#import "ATTwoViewController.h"
#import "MBProgressHUD+Extend.h"

@interface ATTwoViewController ()

@end

@implementation ATTwoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)btnSaved:(id)sender {
    
    //现在，给一个假象
    [MBProgressHUD showMessage:@"正在保存中"];
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [MBProgressHUD hideHUD];
        [MBProgressHUD showSuccess:@"当前已保存到数据库"];
    });
}

- (IBAction)btnChecked:(id)sender {
    
    //现在，给一个假象
    [MBProgressHUD showMessage:@"正在检测中"];
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [MBProgressHUD hideHUD];
        [MBProgressHUD showError:@"功能存在问题，请联系厂家"];
    });
}

- (IBAction)btnGreenOne:(id)sender {
    
    UIAlertController *alertViewCtr = [UIAlertController alertControllerWithTitle:@"🏢相位匹配" message:@"请选择" preferredStyle:UIAlertControllerStyleAlert];
    
    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"取消");
    }];
//    UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
//        NSLog(@"确定");
//    }];
    
    UIAlertAction *flowAction = [UIAlertAction actionWithTitle:@"🚦跟随相位" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"跟随相位");

    }];
    
    UIAlertAction *mainAction = [UIAlertAction actionWithTitle:@"🚏主相位" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"主相位");
        
    }];
    
    [alertViewCtr addAction:cancelAction];
//    [alertViewCtr addAction:sureAction];
    [alertViewCtr addAction:flowAction];
    [alertViewCtr addAction:mainAction];
    
    //    模态视图
    [self presentViewController:alertViewCtr animated:YES completion:^{
        
    }];
}

- (IBAction)btnGreenTwo:(id)sender {
    
    UIAlertController *alertViewCtr = [UIAlertController alertControllerWithTitle:@"🏢相位匹配" message:@"请选择" preferredStyle:UIAlertControllerStyleAlert];
    
    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"取消");
    }];
    //    UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
    //        NSLog(@"确定");
    //    }];
    
    UIAlertAction *flowAction = [UIAlertAction actionWithTitle:@"🚦跟随相位" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"跟随相位");
        
    }];
    
    UIAlertAction *mainAction = [UIAlertAction actionWithTitle:@"🚏主相位" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"主相位");
        
    }];
    
    [alertViewCtr addAction:cancelAction];
    //    [alertViewCtr addAction:sureAction];
    [alertViewCtr addAction:flowAction];
    [alertViewCtr addAction:mainAction];
    
    //    模态视图
    [self presentViewController:alertViewCtr animated:YES completion:^{
        
    }];
}
@end
